import 'package:flutter/material.dart';
import 'package:flutter_resume/config/constants.dart';
import 'package:flutter_svg/flutter_svg.dart';

class KnowledgeText extends StatelessWidget {
  final String text;
  const KnowledgeText({
    Key? key,
    required this.text,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(bottom: defaultPadding / 2),
      child: Row(
        children: [
          SvgPicture.asset('assets/icons/check.svg'),
          SizedBox(width: defaultPadding),
          Expanded(
            child: Text(text),
          )
        ],
      ),
    );
  }
}

class Knowledges extends StatelessWidget {
  const Knowledges({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Divider(),
        Padding(
          padding: const EdgeInsets.symmetric(vertical: defaultPadding),
          child: Text(
            '常用',
            style: Theme.of(context).textTheme.subtitle2,
          ),
        ),
        KnowledgeText(text: 'Flutter, Dart'),
        KnowledgeText(text: 'Vue3, Vuex, Vue-router, Vue-element'),
        KnowledgeText(text: 'React, Redux, React-Router, ant design'),
        KnowledgeText(text: 'Webpack, vite'),
        KnowledgeText(text: 'Git, Markdown'),
      ],
    );
  }
}
